using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SailHero.Soft.FrameWork.Models;

namespace SailHero.Soft.FrameWork.Mapping.HJT212DB
{
    public class PointsOnlineStateMap : EntityTypeConfiguration<PointsOnlineState>
    {
        public PointsOnlineStateMap()
        {
            // Primary Key
            this.HasKey(t => t.State);

            // Properties
            this.Property(t => t.State)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.MN)
                .HasMaxLength(14);

            this.Property(t => t.SType)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("PointsOnlineState");
            this.Property(t => t.State).HasColumnName("State");
            this.Property(t => t.P_ID).HasColumnName("P_ID");
            this.Property(t => t.MN).HasColumnName("MN");
            this.Property(t => t.SType).HasColumnName("SType");
        }
    }
}
